<!DOCTYPE html>
<html>
<head>
    <title></title>
		<#include "/header.html">
</head>
<style>
.form-horizontal {
    width: 750px;
    padding-top: 40px;
    margin: 0 auto;
}
.btn-default {
    color: #444;
    background-color: #fafafa;
    border-color: #ddd;
    width: 75px;
}
</style>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <div class="grid-btn">
			<#if shiro.hasPermission("exam:paperDesign:save")>
            <a class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
			</#if>
			<#if shiro.hasPermission("exam:paperDesign:update")>
            <a class="btn btn-primary" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
			</#if>
			<#if shiro.hasPermission("exam:paperDesign:delete")>
            <a class="btn btn-primary" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
			</#if>
            <#if shiro.hasPermission("exam:paperDesign:produce")>
            <a class="btn btn-primary" @click="produce"><span class="glyphicon glyphicon-play"></span>&nbsp;生成试卷</a>
            </#if>
            <#if shiro.hasPermission("exam:paperDesign:getPaperList")>
            <a class="btn btn-primary" @click="getPaperList"><span class="glyphicon glyphicon-book"></span>&nbsp;试卷查看</a>
            </#if>
        </div>
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>

    <div v-show="!showList" class="panel panel-default">
        <div class="panel-heading">{{title}}</div>
        <form id="paperProduceform" class="form-horizontal" style="width:100%;margin-left:5%;height: 800px;">
            <div>
                <input type="hidden" name="id" v-model="paperDesign.id">
            </div>
			<!-- <div class="form-group">
				<div class="col-sm-2 control-label">专业名称</div> 	
				<div class="col-sm-10">
				    <select v-model="paperDesign.majorId" name="majorId" class="form-control" v-on:change="changeMajor(true)">
				        <option v-for="item in majorList" v-bind:value="item.id">{{item.majorName}}</option>
				    </select>
                </div>
			</div> -->
            
            <div class="form-group" >
                <input type="hidden" name="majorIds" id="majorIds">
                <div class="col-sm-1 control-label">专业名称</div>
                <div class="col-sm-5" v-show="addShow">
                    <select id="majorId" name="majorId" class="selectpicker" multiple  
                    v-on:change="changeMajor(true)" data-live-search="true">
                    </select>
                </div>
                <input type="hidden" name="sectionIds" id="sectionIds">
                <div class="col-sm-1 control-label">章节名称</div>
                <div class="col-sm-5" v-show="addShow">
                    <select id="sectionId" name="sectionId" class="selectpicker" multiple   
                    v-on:change="getCountByType(true)" data-live-search="true">
                    </select>
                </div>
            </div>
            
            
            <!-- <div class="form-group">
                <div class="col-sm-2 control-label">章节名称</div>  
                <div class="col-sm-10">
                    <select v-model="paperDesign.sectionId" name="sectionId" class="form-control" v-on:change="getCountByType(true)">
                        <option v-for="item in sectionList" v-bind:value="item.id">{{item.sectionName}}</option>
                    </select>
                </div>
            </div> -->
            
<!--             <div class="form-group">
                <input type="hidden" name="sectionIds" id="sectionIds">
                <div class="col-sm-2 control-label">章节名称</div>
                <div class="col-sm-10" v-show="addShow">
                    <select id="sectionId" name="sectionId" class="selectpicker" multiple 
                    v-on:change="getCountByType(true)" data-live-search="true">
                    </select>
                </div>
            </div> -->
            
            <div class="form-group">
                <div class="col-sm-1 control-label">试卷名称</div>
                <div class="col-sm-5">
                    <input type="text" class="form-control" v-model="paperDesign.name" name="name" placeholder="试卷名称"/>
                </div>
                <div class="col-sm-1 control-label">试卷数量</div>
				<div class="col-sm-5">
                    <input type="text" class="form-control" v-model="paperDesign.produceQuantity" name="produceQuantity" placeholder="试卷数量"/>
				</div>
            </div>
            <!-- <div class="form-group">
				<div class="col-sm-2 control-label">试卷数量</div>
				<div class="col-sm-10">
                    <input type="text" class="form-control" v-model="paperDesign.produceQuantity" name="produceQuantity" placeholder="试卷数量"/>
				</div>
			</div> -->
			<div class="form-group">
                <div class="col-sm-1 control-label">题目总数</div>
                <div class="col-sm-5">
                    <input type="text" class="form-control" v-model="paperDesign.questionQuantity" name="questionQuantity" placeholder="题目总数" readonly="readonly"/>
                </div>
                 <div class="col-sm-1 control-label">试卷总分</div>
                <div class="col-sm-5">
                    <input type="text" class="form-control" v-model="paperDesign.totalScore" name="totalScore" placeholder="试卷总分" readonly="readonly"/>
                </div>
            </div>
<!-- 			<div class="form-group">
                <div class="col-sm-2 control-label">试卷总分</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="paperDesign.totalScore" name="totalScore" placeholder="试卷总分" readonly="readonly"/>
                </div>
            </div>
 -->            
			 <div  id="mytable"></div>
            <div class="form-group col-md-12">
                        <div class="col-sm-2 control-label"></div>
                        <input type="button" class="btn btn-primary" @click="saveOrUpdate" value="确定" /> &nbsp;&nbsp;
                        <input type="button" class="btn btn-warning" @click="reload" value="返回" />
            </div>
        </form>
    </div>
</div>

<div id="produceListLayer" style="display: none;padding:10px;">
	<ul id="deptTree" class="ztree"></ul>
</div>

<div id="paperList" style="display: none;padding:10px;">
    <table id="paperJqGrid"></table>
    <div id="paperJqGridPager"></div>
</div>

<div id="paperInfo" style="display: none;padding:10px;">
</div>

<script src="${request.contextPath}/statics/js/modules/exam/paperDesign.js?_${.now?long}"></script>
</body>
<style>
.bootstrap-select:not([class*=col-]):not([class*=form-control]):not(.input-group-btn){
width:100%
}
</style>
</html>
